@extends('admin.layouts.layout')
@section('content')
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox-title">
                <h5>单服充值情况</h5>
            </div>
            <div class="ibox-content">
                <form class="form-horizontal " action="{{route('stat.server')}}" method="post"
                      enctype="multipart/form-data">
                    {!! csrf_field() !!}
                    <table class="table-striped table-bordered table-hover table-condensed">
                        <tr class="b-group">
                            <td class="b-child" colspan="2">
                                <table class="table-striped table-bordered table-hover table-condensed"
                                       style="margin: 0px;">
                                    <tr class="b-group">
                                        <td>
                                            @include('widget.between_datetime')
                                        </td>
                                        <td>
                                            @include('widget.query_and_refresh')
                                        </td>
                                        <td>
                                            @include('widget.dataType',['dataType'=>\App\Models\Enum\DataType::YESTERDAY])
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr class="b-group">
                            <th width="10%">
                                <label>全选/不选&nbsp;&nbsp;
                                    <input type="checkbox" checked="checked" value=""
                                           onclick="checkAll(this)"></label>
                            </th>
                            <td class="b-child">
                                <div style="max-height:6.5rem;overflow-y:scroll;">
                                    @include('widget.channel')
                                </div>
                            </td>
                        </tr>
                        <tr class="b-group">
                            <th width="10%">
                                <label>全选/不选&nbsp;&nbsp;
                                    <input type="checkbox" checked="checked" value="" onclick="checkAll(this)"></label>
                            </th>
                            <td class="b-child">
                                <div style="max-height:10rem;overflow-y:scroll;">
                                    @include('widget.server')
                                </div>
                            </td>
                        </tr>
                    </table>
                    <input type="hidden" name="page_size" value="{{$reqPageSize}}"/>
                </form>
                <table class="table table-striped table-bordered table-hover m-t-md tblData">
                    <thead>
                    <tr>
                        <th class="text-center">代理</th>
                        <th class="text-center">今日总金额</th>
                        <th class="text-center">今日充值人数</th>
                        <th class="text-center">昨日充值人数</th>
                        <th class="text-center"><a href="javascript:;" data-toggle="tooltip" data-placement="top"
                                                   title="今日总金额 / 活跃用户">今日ARPU</a></th>
                        <th class="text-center">昨日ARPU</th>
                        <th class="text-center"><a href="javascript:;" data-toggle="tooltip" data-placement="top"
                                                   title="今日总金额 / 今日充值人数">今日ARPPU</a></th>
                        <th class="text-center">昨日ARPPU</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($serverStat as $key => $item)
                        <tr>
                            <td>{{$item['channel_name']}}-{{$item['server_name']}}</td>
                            <td>{{$item['amounts']}}</td>
                            <td>{{$item['pay_users']}}</td>
                            <td>{{$item['yesterday_pay_users']}}</td>
                            <td>{{$item['arpu']}}</td>
                            <td>{{$item['yesterday_arpu']}}</td>
                            <td>{{$item['arppu']}}</td>
                            <td>{{$item['yesterday_arppu']}}</td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                <div class="pull-left pagination m-t-no">
                    @include('widget.page',['reqPageSize'=>$reqPageSize])
                </div>
                <div class="pull-right pagination m-t-no">
                    <div class="text-center">
                        <?php
                        if (count($serverStat) > 0) {
                            echo $serverStat->appends(
                                [
                                    'start_time' => $reqStartTime,
                                    'channel_id' => $str_arr_channels_id,
                                    'unique_id' => $str_arr_unique_id,
                                    'page_size' => app('request')->input('page_size'),
                                    'data_type' => app('request')->input('data_type'),
                                ])->links();
                        }
                        ?>
                    </div>
                    <div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <script>
    </script>
    <link href="{{loadEdition('/admin/css/plugins/datapicker/bootstrap-datepicker.css')}}" rel="stylesheet">
@endsection
@section('js')
    <script src="{{loadEdition('/admin/js/plugins/datapicker/bootstrap-datepicker.js')}}"></script>
    <script src="{{loadEdition('/admin/js/plugins/datapicker/bootstrap-datepicker.zh-CN.js')}}"></script>
    <script src="{{loadEdition('/js/global.js')}}"></script>
@stop